package com.rpc.test.client.boot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/*********
 *
 *
 *@author 197
 *@date 2020/6/18 21:17
 *
 **/


@ComponentScan("com.rpc.test.client")
@SpringBootApplication
public class RpcConsumerApplication {

  public static void main(String[] args) throws InterruptedException {

    ConfigurableApplicationContext context = SpringApplication
        .run(RpcConsumerApplication.class, "--spring.profiles.active=client");

//    String[] beanDefinitionNames = context.getBeanDefinitionNames();
//    Arrays.stream(beanDefinitionNames).forEach(System.out::println);
//    Object producerApiImpl = context.getBean("producerApiImpl");
//    ConsumerApi ConsumerApi = context.getBean(ConsumerApi.class);
//    FlowRes hiRes = ConsumerApi.hi(new FlowReq().append("", RandomStringUtils.randomAlphanumeric(5)));
//    System.out.println(hiRes);

//    hiRes = ConsumerApi.hi(new HiReq().setHi(RandomStringUtils.randomAlphanumeric(5)));
//    System.out.println(hiRes);
//
//    hiRes = ConsumerApi.hi(new HiReq().setHi(RandomStringUtils.randomAlphanumeric(5)));
//    System.out.println(hiRes);
//
//    hiRes = ConsumerApi.hi(new HiReq().setHi(RandomStringUtils.randomAlphanumeric(5)));
//    System.out.println(hiRes);
  }

}
